var n, o = getApp(), t = require("../../utils/util.js");

o.globalData.token;

Page({
    onLoad: function(o) {
        n = this;
    },
    mycoupons: function() {
        wx.navigateTo({
            url: "coupons/index"
        });
    },
    onMyCar: function(n) {
        wx.navigateTo({
            url: "myCar/myCar"
        });
    },
    onAddressAdmin: function(n) {
        wx.chooseAddress({
            success: function(n) {}
        });
    },
    onOpenShext: function(n) {
        wx.navigateTo({
            url: "openShext/openShext"
        });
    },
    carinfo: function(n) {
        wx.navigateTo({
            url: "page/myCar/myCar"
        });
    },
    onModel: function(n) {
        wx.showModal({
            title: "仁通洗车",
            content: "智能化洗车平台\nTel: 4006046606",
            confirmText: "拨打",
            cancelText: "关闭",
            success: function(n) {
                n.confirm ? wx.makePhoneCall({
                    phoneNumber: "4006046606"
                }) : n.cancel;
            }
        });
    },
    onShow: function() {},
    acount: function() {
        wx.navigateTo({
            url: "acount/acount"
        });
    },
    getPerson: function() {
        wx.navigateTo({
            url: "/pages/info/person/person"
        });
    },
    checkVersion: function() {
        var n = wx.getUpdateManager();
        n.onCheckForUpdate(function(n) {
            n.hasUpdate || wx.showToast({
                title: "当前是最新版本",
                icon: "none"
            });
        }), n.onUpdateReady(function() {
            wx.showModal({
                title: "更新提示",
                content: "新版本已经准备好，是否重启应用？",
                success: function(o) {
                    o.confirm && n.applyUpdate();
                }
            });
        }), n.onUpdateFailed(function() {
            wx.showToast({
                title: "更新失败",
                icon: "none"
            });
        });
    },
    share: function() {
        var n = o.globalData.token;
        t.request(o, "wx/mkt/getActivityById", "GET", {
            token: n,
            activityId: 1
        }, function(n) {
            n.state && (null != n.data ? wx.navigateTo({
                url: "/pages/info/share/index"
            }) : wx.showToast({
                title: "活动敬请期待",
                icon: "none"
            }));
        });
    }
});